package com.solutec.dia4;

public class AufgabeWhileDoWhile {

	public static void main(String[] args) {

		//		- Folgende Zahlenreihe bitte in einer Zeile ausgeben: 0 2 3 4 5 6 7 8 9
		System.out.println();
		System.out.println("--------");
		int i1 = 0;
		while ( i1 <= 9 ){
			if(i1!=1)
			System.out.print(i1 + " ");
		i1++;
		}
		
//		Folgende Zahlenreihe bitte in einer Zeile ausgeben: -4 -2 0 2 4 ... 50
		System.out.println();
		System.out.println("--------");
		i1=-4;
		while( i1 <= 50 ){
			System.out.print(i1 +" ");
			i1+=2;
		}
		System.out.println();
		System.out.println("---do-While---");
		// 	do while
		i1=-4;
		do{
			System.out.print(i1 +" ");
			i1+=2;
		}while(i1 <= 50);
		
		
		
		
		System.out.println();
		System.out.println("--------");
		char ch1 = 'a';
		while( ch1 <= 'z'){
			System.out.print(ch1 +" ");
			ch1++;
		}
		
		
		System.out.println();
		System.out.println("--------");
		char ch2 = 'Z';
		while( ch2 >= 'A'){
			System.out.print(ch2 +" ");
			ch2--;
		}
		
		System.out.println();
		System.out.println("--------");
		int i2 = 3; 
		int i3 = 1;
		
		while (i2>0){
			System.out.print(i2 + " ");
			while (i3<=i2){
				System.out.print(i3 +" ");
				i3++;
			}
			i2--;
		}
		
		//i2 = 1
		//i3 = 1
		
		//3 1 2 3 2 1 2 1 1
		
		
		//Veamos como hace el profesor
		System.out.println();
		i1 = 3;
		while(i1 > 0){
			System.out.print(i1 + " ");
			
			int i4 = 1;
			do{
				System.out.print(i4 + " ");
				i4++;
			}while(i4 <= i1);
			
			i1--;
		}
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
		
	}// end of main

}
